<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="renderer" content="webkit">
<title></title>
<link rel="stylesheet" href="__PUBLIC__/Admin/css/pintuer.css">
<link rel="stylesheet" href="__PUBLIC__/Admin/css/admin.css">
<script src="__PUBLIC__/Admin/js/jquery.js"></script>
<script src="__PUBLIC__/Admin/js/pintuer.js"></script>
</head>
<body>
<div class="panel admin-panel">
  <div class="panel-head" id="add"><strong><span class="icon-pencil-square-o"></span>添加房源</strong></div>
  <div class="body-content">
    <form method="post" class="form-x" action="" enctype="multipart/form-data"> 
   <!--   <div class="form-group">
       <div class="label">
         <label>发布方：</label>
       </div>
       <div class="field">
         <input type="text" class="input w50" value="" name="user" data-validate="required:请输入发布方" />
         <div class="tips"></div>
       </div>
     </div> --> 
      <div class="form-group">
        <div class="label">
          <label>小区名称：</label>
        </div>
        <div class="field">
          <input type="text" class="input w50" value="" name="name" data-validate="required:请输入小区名称" />
          <div class="tips"></div>
        </div>
      </div>
      <div class="form-group">
        <div class="label">
          <label>标题：</label>
        </div>
        <div class="field">
          <input type="text" class="input w50" value="" name="note" data-validate="required:请输入标题" />
          <div class="tips"></div>
        </div>
      </div>
         <div class="form-group">
        <div class="label">
          <label>户型：</label>
        </div>
        <div class="field">
          <select class="in-drop" name="huxing">
            <option value="一室一厅一卫">一室一厅一卫</option>
            <option value="一室一厅两卫">一室一厅两卫</option>
            <option value="两室一厅一卫">两室一厅一卫</option>
            <option value="两室一厅两卫">两室一厅两卫</option>
            <option value="三室一厅一卫">三室一厅一卫</option>
            <option value="三室一厅两卫">三室一厅两卫</option>
            <option value="四室两厅两卫">四室两厅两卫</option>
            <option value="平层户型">平层户型</option>
            <option value="错层户型">错层户型</option>
            <option value="跃层户型">跃层户型</option>
            <option value="复式户型">复式户型</option>
          </select>
          <div class="tips"></div>
        </div>
      </div>
        <div class="form-group">
        <div class="label">
          <label>建筑面积：</label>
        </div>
        <div class="field">
          <input type="text" class="input w50" value="" name="mianji" data-validate="required:请输入建筑面积" />
          <div class="tips"></div>
        </div>
      </div>
         <div class="form-group">
        <div class="label">
          <label>价格：</label>
        </div>
        <div class="field">
          <input type="text" class="input w50" value="" name="price" data-validate="required:请输入价格" />
          <div class="tips"></div>
        </div>
      </div>
      <div class="form-group">
        <div class="label">
          <label>房源图片：</label>
        </div>
        <div class="field">
          <input type="file" id="url1" name="pic" class="input tips" style="width:25%; float:left;"  value=""  data-toggle="hover" data-place="right" data-image="" />
        </div>
      </div>
       <div class="form-group">
        <div class="label">
          <label>省份：</label>
        </div>
        <div class="field" >
          <select name="provincecode" id="sheng">
            <option value="">请选择</option>
            <volist name='info' id='v'>
            <option value="{$v.code}">{$v.name}</option>
            </volist>
          </select>
          <div class="tips"></div>
        </div>
      </div>
       <div class="form-group" >
        <div class="label">
          <label>市区：</label>
        </div>
        <div class="field">
          <select name="citycode" id="city">
            <option value="">请选择</option>
          </select>
          <div class="tips"></div>
        </div>
      </div>
       <div class="form-group" >
        <div class="label">
          <label>县区：</label>
        </div>
        <div class="field">
          <select name="areacode" id="area">
            <option value="">请选择</option>
          </select>
          <div class="tips"></div>
        </div>
      </div>
      <div class="form-group">
        <div class="label">
          <label></label>
        </div>
        <div class="field">
          <button class="button bg-main icon-check-square-o" type="submit"> 提交</button>
        </div>
      </div>
    </form>
  </div>
</div>

</body></html>
<script type="text/javascript">
  $(function(){
    //省份发生改变时候的js事件
    $('#sheng').change(function(){
      var code = $(this).children('option:checked').val();
      $.ajax({
        url: '__APP__/Home/Manage/showCity',
        type: 'POST',
        data: {code: code},
        success:function(msg){
           $("#city").html('');
          if(msg.flag == true){
              var  op = '<option value="">请选择</option>';
              for (var i = 0; i < msg.info.length; i++) {
                op += '<option value=' +  msg.info[i].code + '>';
                          op +=  msg.info[i].name;
                          op += '</option>';
              }
              $("#city").append(op);
          }else{
            alert('请重新选择');
          }
        }
      })
    })
    //市区发生改变时候的js事件
      $('#city').change(function(){
      var code = $(this).children('option:checked').val();
      $.ajax({
        url: '__APP__/Home/Manage/showArea',
        type: 'POST',
        data: {code: code},
        success:function(msg){
           $("#area").html('');
          if(msg.flag == true){
              var  op = '<option value="">请选择</option>';
              for (var i = 0; i < msg.info.length; i++) {
                op += '<option value=' +  msg.info[i].code + '>';
                          op +=  msg.info[i].name;
                          op += '</option>';
              }
              $("#area").append(op);
          }else{
            alert('请重新选择');
          }
        }
      })
    })
  })
  </script>